a = 1
while a == 1:
 alpha = input("按Q退出，按其他任意键继续：")
 pm = float(input("请输入pm2.5的值："))
 if alpha == "Q":
     break
 else:
  if 0<pm<50:
    print("空气质量优")
  elif 51<pm<100:
    print("空气质量良")
  elif 101<pm<150:
    print("轻度污染")
  elif 151<pm<200:
    print("中度污染")
  elif 201<pm<300:
    print("重度污染")
  else:
    print("严重污染")
